<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sinox="http://www.sinosoft.com.cn/sinox"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:decorate template="/layout/input/editable-template.xhtml">
		<!-- 第一行 -->
		<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
			<ui:param name="compType" value="single" />
			<ui:param name="compBean1Id" value="formType" />
			<ui:param name="compBean1Lable" value="表单类别" />
			
			<ui:define name="compBean1Content">
				<sinox:selectOneRadio id="#{compBean1Id}" value="#{partViewBean.fields.formType}"
					items="#{bpmSelectItemsService.items.formType}" />
			</ui:define>
			
		</ui:decorate>
		
		<!-- 第二行 -->
		<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
			<ui:param name="compBean1Id" value="formId" />
			<ui:param name="compBean1Lable" value="表单ID" />
			
			<ui:define name="compBean1Content">
				 <h:inputText id="#{compBean1Id}" value="#{partViewBean.fields.formId}" />
			</ui:define>
			
			<ui:param name="compBean2Id" value="formPageUrl" />
			<ui:param name="compBean2Lable" value="表单页面路径" />
			
			<ui:define name="compBean2Content">
				 <h:inputText id="#{compBean2Id}" value="#{partViewBean.fields.formPageUrl}" />
			</ui:define>
		</ui:decorate>
		
		<!-- 第三行 -->
		<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
			<ui:param name="compBean1Id" value="helpDoc" />
			<ui:param name="compBean1Lable" value="表单视图帮助" />
			
			<ui:define name="compBean1Content">
				 <h:inputText id="#{compBean1Id}" value="#{partViewBean.fields.helpDoc}" />
			</ui:define>
			
			<ui:param name="compBean2Id" value="cascade" />
			<ui:param name="compBean2Lable" value="是否级联删除" />
			
			<ui:define name="compBean2Content">
				 <sinox:selectBooleanCheckbox id="#{compBean2Id}" value="#{partViewBean.fields.cascade}" />
			</ui:define>
		</ui:decorate>
		
		<!-- 第四行 -->
		<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
			<ui:param name="compType" value="single-all" />
			<ui:param name="compBean1Id" value="formElementTable" />
			<ui:param name="compBean1Editable" value="false" />
			
			<ui:define name="compBean1Content">
				<p:toolbar height="22px" styleClass="sino-toolbar-on-datatable">
					<p:toolbarGroup align="left">
				    	<div style="float:left;">
				    		<p:spacer width="10" height="25" />
				    	</div>
				    	<div style="float:left;margin-top:5px;">
				    		<h:outputText value="表单属性控制列表"/>
				    	</div>
				    </p:toolbarGroup>
				    
				    <p:toolbarGroup align="right">
				    	<p:commandButton title="添加" value="添加"
							actionListener="#{bpmAction.addFormElementAction}"
							update="#{compBean1Id}">
							<h:inputHidden value="#{partViewBean.id}" />
						</p:commandButton>
						
						<p:commandButton title="删除" value="删除"
							actionListener="#{bpmAction.removeFormElementAction}"
							update="#{compBean1Id}">
							<h:inputHidden value="#{partViewBean.id}" />
						</p:commandButton>
				    </p:toolbarGroup>
				</p:toolbar>
				
				<p:dataTable id="#{compBean1Id}" var="fe" value="#{partViewBean.formElements}"
			        emptyMessage="请添加表单属性" selectionMode="multiple" rowIndexVar="fevar"
			        selection="#{partViewBean.selectedRows}">
			  		
			  		<p:column headerText="序号" style="width:20px;">
			  			<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{fevar + 1}"/>
			                </f:facet>  
			                <f:facet name="input">
								<h:outputText value="#{fevar + 1}"/>
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="字段ID" style="width:50px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{fe.fieldId}" />  
			                </f:facet>  
			                <f:facet name="input">
			                	<h:inputText value="#{fe.fieldId}" style="width:100%"/>  
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="是否显示" style="width:50px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{(fe.show)?'是':'否'}" />
			                </f:facet>  
			                <f:facet name="input">  
			                    <sinox:selectBooleanCheckbox value="#{fe.show}" />
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="是否编辑" style="width:50px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{(fe.edit)?'是':'否'}" />
			                </f:facet>  
			                <f:facet name="input">  
			                    <sinox:selectBooleanCheckbox value="#{fe.edit}" />
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="是否必填" style="width:50px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{(fe.request)?'是':'否'}" />  
			                </f:facet>  
			                <f:facet name="input">  
			                    <sinox:selectBooleanCheckbox value="#{fe.request}" />
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="默认值">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{fe.defaultValue}" />  
			                </f:facet>  
			                <f:facet name="input">  
			                    <h:inputText value="#{fe.defaultValue}" style="width:100%"/>  
			                </f:facet>
			            </p:cellEditor>
					</p:column>
			  		
			  		 <p:column headerText="编辑" style="width:20px;">  
			            <p:rowEditor />  
			        </p:column>
			    </p:dataTable>
			</ui:define>
		</ui:decorate>
		
	</ui:decorate>
</ui:composition>